package com.itheima01;

import java.sql.SQLOutput;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Homework3 {
    public static void main(String[] args) throws ParseException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个生日:");
        String s1 = sc.nextLine();
        System.out.println("请输入第二个生日:");
        String s2 = sc.nextLine();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年M月d日");
        long time1 = sdf.parse(s1).getTime();
        long time2 = sdf.parse(s2).getTime();
        Date s3 = new Date();
        long time3 = s3.getTime();
        if (time1 > time3 || time2 > time3) {
            System.out.println("生日日期必须早于当前日期!");
        } else if (time1 > time2) {
            System.out.println("第一个生日小于第二个生日!");
        } else {
            System.out.println("第一个生日大于第二个生日!");
        }
    }
}
